public class Client {
    public static void main(String[] args) {
        //创建中介类
        Mediator Mediator = new ConcreteMediator();
        //创建同事类
        TV tv = new TV("TV", Mediator);
        CoffeeMa coffeeMa = new CoffeeMa("CoffeeMa", Mediator);

        //将同事注册到中介上
        Mediator.resister(tv.getName(),tv);
        Mediator.resister(coffeeMa.getName(),coffeeMa);
        System.out.println("tv发送指令1");
        tv.sendMessage(1);
        System.out.println("tv发送指令2");
        tv.sendMessage(2);
    }
}
